<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.view.*" %>

<%@page pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>

<%
	User user = (User) request.getAttribute("user");
	Bookmarks bookmarks = user.getBookmarks();
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		
		<title>Blog View</title>
		
		<link rel="stylesheet" title="Conversation Board" type="text/css" href="${contextPath}/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>"></link>
		<script src="${contextPath}/Javascript/bbCodeize.js" type="text/javascript"></script> 
		<script src="${contextPath}/Javascript/style.js" type="text/javascript"></script>
		<script src="${contextPath}/Javascript/ajax.js" type="text/javascript"></script>
	</head>

	<body>

		<%= MainMenu.display(request.getUserPrincipal()) %>

		<c:if test="${user.yellowCarded}">
			<div class="yellowcard">You Have Been Yellow Carded By a Moderator: ${user.yellowCardReason}</div>
		</c:if>

		<%= BookmarksDisplay.display(bookmarks, false) %>

		<div class="headingblock">
			<h1>Blog View</h1>
		</div>
	
		<div class="mainblock">		

			<c:forEach var="entry" items="${blogEntries}">
				
				<h3><a href="${contextPath}/ThreadSelectedControllerServlet?boardid=${entry.boardId}&threadid=${entry.threadId}">${entry.threadName}</a> <span class="threaddata">last updated: <span class="threadlu">${entry.lastUpdated}</span> by <span class="threadlu">${entry.lastUpdatedBy}</span></span></h3>
					
				<c:forEach var="post" items="${entry.posts}">
	
					<c:choose>			
						<c:when test="${post.question}">
							<div class="sitemessage" style="margin-left: 0em; margin-right: 0em;">${post.post}
								<p><span class="threadlu">― ${post.displayName}, ${post.timePosted}</span></p>
							</div>
						</c:when>
					
						<c:otherwise>
							<span class="threaddata">${post.post}</span>
							<p><span class="threadlu">― ${post.displayName}, ${post.timePosted}</span></p>
						</c:otherwise>
					</c:choose>
				</c:forEach>				

				<br /><br />
			
			</c:forEach>
			
		</div>
	
		<%= MainMenu.display(request.getUserPrincipal()) %>
			
		<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
		<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
		
	</body>
	
</html>
